/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package threads;

import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author anh_yeu_em_nhieu_lam
 */
public class ThreadBasicOne extends Thread {
    @Override
    public void run(){
        try {
            for(int i=0;i<3;i++){
                Thread.sleep(2000);
                System.out.print(Thread.currentThread().getName() + " " + i);
            }
        } catch (InterruptedException ex) {
            Logger.getLogger(ThreadBasicOne.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    /*
    public static void main(String args[]){
        System.out.print(Thread.currentThread().getName()+"\n");
        ThreadBasicOne t = new ThreadBasicOne();
        t.start();
        while(t.isAlive()){
            try {
                System.out.print("Wait.....\n");
                t.join(1000);
            } catch (InterruptedException ex) {
                Logger.getLogger(ThreadBasicOne.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }**/
}
